import {request} from "@utils/http"
import { hospiatlShow, ProvinceList, ReqGetHospitalListParams, ReqGetHospitalListResponse } from "./model/hospitalListTypes";

export function reqGetHospitalList({page,limit,...args}:ReqGetHospitalListParams){
    return request.get<any,ReqGetHospitalListResponse>(`/admin/hosp/hospital/${page}/${limit}`,{
        params:args
    })
}

// 请求省份的api
export function reqGetProvinceList(){
    return request.get<any,ProvinceList>("/admin/cmn/dict/findByDictCode/province")
}

// 请求市的api
//   id  省份id
export function reqGetcityList(id:number){
    return request.get<any,ProvinceList>(`/admin/cmn/dict/findByParentId/${id}`)
}

// 请求区的api
//  id  市的id
export function reqGetdistrictList(id:number){
    return request.get<any,ProvinceList>(`/admin/cmn/dict/findByParentId/${id}`)
}

// 请求医院等级api 
// 固定值   10000
export function reqGethostypeList(){
    return request.get<any,ProvinceList>(`/admin/cmn/dict/findByParentId/10000`)
}


// 请求医院详情
export function reqGethostypeListContentShow(id:string){
    return request.get<any,hospiatlShow>(`/admin/hosp/hospital/show/${id}`)
}

// 医院上下线 请求
export function reqUpdateHospitalStatus(id:string,status:number){
    return request.get<any,null>(`/admin/hosp/hospital/updateStatus/${id}/${status}`)
}